package cn.javass.dp.observer.example3;

import java.util.Observable;
import java.util.Observer;

public class Reader implements Observer {

    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public void update(Observable o, Object arg) {
        System.out.println("name = " + name +", 这是推模型++++阅读的内容是" + arg);

        System.out.println("name = " + name +", 这是拉模型————————阅读的内容是" + ((NewPaper)o).getContent());
    }
}
